<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class User {

    private $CI;
    public $session_name = "dbUser";

    public function __construct() {
        $this->CI = & get_instance();
    }

    public function isLogged() {
        if ($this->CI->session->userdata($this->session_name)) {
            return true;
        } else {
            return false;
        }
    }

    public function setData($value) {
        $this->CI->session->set_userdata($this->session_name, $value);
    }

    public function unsetData() {
        $this->CI->session->unset_userdata($this->session_name);
    }
    
    public function getData() {
        return $this->CI->session->userdata($this->session_name);
    }

}

?>
